<?php

namespace App\Transformers;

use App\Models\Menu;
use League\Fractal\TransformerAbstract;

class MenuTransformer extends TransformerAbstract
{
    public function transform(Menu $menu)
    {
        return [
            'id' => $menu->id,
            'name' => $menu->name,
            'file' => $menu->file,
            'path' => $menu->path,
            'pid' => $menu->pid,
            'status' => $menu->status,
            'icon' => $menu->icon,
            'sort' => $menu->sort,
            'children' => $menu->children,
            'created_at' => $menu->created_at,
            'updated_at' => $menu->updated_at,
        ];
    }
}
